import {request} from "./request";

export function findAll(data) {
  return request({
    url: '/duty/search',
    data:
      {
        "pageNo": data.pageNo,
        "pageSize": data.pageSize
      },
      // data,
    method: 'post'
  })
}

export function findById(data) {
  return request({
    url: '/duty/findById',
    params:
      {
        "ddid": data
      },
      // data,
    method: 'post'
  })
}


export function findByUsername(data) {
  return request({
    url: '/user/findByName',
    params:
      {
        realName: data
      },
      // data,
    method: 'post'
  })
}


export function add(user) {
  return request({
    url: '/duty/add',
    data:{
      docid: user.docId,
      dutyday: user.dutyday
    },
    // data,
    method: 'post'
  })
}

export function edit(user) {
  console.log("修改数据")
  console.log(user)
  return request({
    url: '/duty/add',
    data:
      {
        ddid: user.ddid,
        docid: user.docid,
        dutyday: user.dutyday
      },
    // data,
    method: 'post'
  })
}

export function del(id) {
  return request({
    url: '/doctors/del',
    params:
      {
        docId: id
      },
    // data,
    method: 'post'
  })
}



